<template>
	<view class="studentFile">
		<view v-if="studentList.length > 0" class="listBox">
			<view class="listitem" v-for="(item,index) in studentList">
				<view class="topBox" @click="handleDetail(item)">
					<view class="" style="display: flex;align-items: center;">
						<image src="../../static/image/iconfool.png" style="width: 48rpx;height: 48rpx;" mode="">
						</image>
						<view class="" style="margin-left: 20rpx;">
							学生信息{{index+1}}
						</view>
					</view>

					<view class="" style="display: flex;align-items: center;">
						<view class="">
							查看详情
						</view>
						<image src="../../static/image/rightblue.png" mode=""
							style="width: 40rpx;height: 40rpx;margin-left: 10rpx;"></image>
					</view>

				</view>
				<view class="content" @click="handleDetail(item)">
					<view class="contenttop">
						<view class="lable">
							学生姓名
						</view>
						<view class="lable">
							在读学校
						</view>
						<view class="lable">
							在读国家
						</view>

					</view>
					<view class="contentBottom">
						<view class="value">
							{{item.name == null ? '' : item.name}}
						</view>
						<view class="value">
							{{item.school == null ? '': item.school}}
						</view>
						<view class="value">
							{{item.country == null ? '': item.country}}
						</view>

					</view>

				</view>
				<view class="heng"></view>
				<view class="footerBox">

					<view class="footeritem" @click="handleRW(item)">
						<image class="icon" src="../../static/image/icon1.png" mode=""></image>
						<view class="">
							任务列表
						</view>
					</view>
					<view class="footeritem" @click="handleHY(item)">
						<image class="icon" src="../../static/image/icon2.png" mode=""></image>
						<view class="">
							会议列表
						</view>
					</view>
					<view class="footeritem" @click="handleSQ(item)">
						<image class="icon" src="../../static/image/icon3.png" mode=""></image>
						<view class="">
							申请列表
						</view>
					</view>
					<view class="footeritem" @click="handleCJ(item)">
						<image class="icon" src="../../static/image/icon4.png" mode=""></image>
						<view class="">
							成绩列表
						</view>
					</view>
					<view class="footeritem" @click="handleKWHD(item)">
						<image class="icon" src="../../static/image/icon5.png" mode=""></image>
						<view class="">
							课外活动
						</view>
					</view>

				</view>
			</view>
		</view>


		<view v-if="studentList.length==0" class="nullBox">
			<image src="../../static/image/nullimg.png" style="width: 148rpx;height: 148rpx;" mode=""></image>
			<view class="">
				暂无信息
			</view>
		</view>




		<view class="" style="height: 100rpx;"></view>
	</view>
</template>

<script>
	import {
		studentList
	} from "@/api/api.js"
	export default {
		data() {
			return {
				studentList: [],
				page: 1,
				page_size: 10

			}
		},
		onLoad() {
			this.handlestudentList()
		},
		onPullDownRefresh() {
			// console.log("触发了下拉刷新"),
			this.handlestudentList()
			uni.stopPullDownRefresh();
		},
		//上拉加载
		onReachBottom() {
			this.page++;
			this.handlestudentList();
		},
		methods: {
			async handlestudentList() {
				let res = await studentList({
					page: this.page,
					page_size: this.page_size
				})
				res.data.data.forEach((item, index) => {
					this.studentList.push(item)
				})
			},
			handleDetail(item) {
				uni.navigateTo({
					url: `/pages/mine/archivesMessage?id=${item.id}`
				})
			},

			//任务列表
			handleRW(item) {
				uni.navigateTo({
					url: `./myMission?id=${item.id}`
				})
			},

			//会议列表
			handleHY(item) {
				uni.navigateTo({
					url: `./meetingMinutes?id=${item.id}`
				})
			},

			//申请列表
			handleSQ(item) {
				uni.navigateTo({
					url: `./myApplication?id=${item.id}`
				})
			},

			//成绩列表
			handleCJ(item) {
				uni.navigateTo({
					url: `./academicAchievement?id=${item.id}`
				})
			},

			//课外活动
			handleKWHD(item) {
				uni.navigateTo({
					url: `./extracurricularActivities?id=${item.id}`
				})
			},

		}
	}
</script>

<style scoped lang="scss">
	.studentFile {
		padding: 30rpx;
		box-sizing: border-box;

		.nullBox {
			font-size: 28rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			color: #AEB8C2;
			line-height: 28rpx;
			width: 148rpx;
			text-align: center;
			margin: 0 auto;
			margin-top: 200rpx;
		}


		.listBox {
			.listitem {
				width: 690rpx;
				// height: 354rpx;
				background: #FFFFFF;
				border-radius: 16rpx 16rpx 16rpx 16rpx;
				margin-bottom: 30rpx;

				.topBox {
					width: 690rpx;
					height: 92rpx;
					background: #E1E8FD;
					border-radius: 16rpx 16rpx 0 0;
					padding: 22rpx 20rpx;
					box-sizing: border-box;
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-size: 32rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					color: #255A9B;
					line-height: 32rpx;
				}

				.content {
					padding: 30rpx;
					box-sizing: border-box;

					.contenttop {
						display: flex;
						text-align: center;

						.lable {
							width: 33.33%;
							font-size: 28rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							color: #232832;
							line-height: 36rpx;
						}

					}

					.contentBottom {
						display: flex;
						margin-top: 30rpx;

						.value {
							font-size: 28rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							color: #9E9E9E;
							line-height: 36rpx;
							width: 33.33%;
							text-align: center;
						}
					}
				}

				.heng {
					width: 650rpx;
					height: 1rpx;
					background-color: #F4F4F7;
					margin: 0 auto;
				}

				.footerBox {

					padding: 30rpx 60rpx;
					box-sizing: border-box;
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #CCCCCC;
					line-height: 28rpx;
					// background-color: pink;
					display: flex;

					.footeritem {
						width: 96rpx;
						font-size: 24rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						color: #255A9B;
						line-height: 24rpx;
						text-align: center;

						.icon {
							width: 50rpx;
							height: 50rpx;
							margin-bottom: 30rpx;
						}
					}
				}

			}
		}

	}
</style>